package com.shawn.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shawn.model.entity.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author shawn
 * @date 2022年 11月 12日 15:44
 */

public interface OptionsMapper extends BaseMapper<Options> {
    @Select("<script>select sum(score) from tb_options where id in " +
            "<foreach item = 'optionId' index = 'index' collection = 'optionIds' open='(' separator=',' close=')'>" +
            "#{optionId}" +
            "</foreach>" +
            "</script>")
    Integer getScoreByIds(List<String> optionIds);
}
